import axios from "axios";

export function InterfaceList(data) {
  return axios({
    url: "http://localhost:3001/data",
    params: data,
  });
}

export function Added(data) {
  return axios({
    url: "http://localhost:3001/data",
    method: "post",
    data,
  });
}

export function deletes(id) {
  return axios({
    url: `http://localhost:3001/data/${id}`,
    method: "delete",
  });
}

export function compiles(data) {
  return axios({
    url: `http://localhost:3001/data/${data.id}`,
    method: "put",
    data: data,
  });
}

export function particulars(id) {
  return axios({
    url: `http://localhost:3001/data/${id}`,
  });
}

export function search() {
  return axios({
    url: `http://localhost:3001/data/?name=关键词`,
  });
}

export function sousuo(name) {
  return axios({
    url: `http://localhost:3001/data/?name=${name}`,
    method: "get",
  });
}
